<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 */
class ArticleLike extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'article_likes';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = ['user_id', 'article_id'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = [];

    const UPDATED_AT = null;
    /**
     * 关联用户
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    /**
     * 关联文章
     */
    public function article()
    {
        return $this->belongsTo(Articles::class, 'article_id');
    }
}